package store.lunangangster.bpmn.model;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Bpmn中process模型的描述
 * 
 * @author cwk
 * @version 1.0
 */
public class Process extends BaseElement implements FlowElementsContainer {

  protected String name;
  protected boolean isExecutable;
  protected Map<String, FlowElement> flowElements = new LinkedHashMap<>();

  // the element to start this Process
  protected FlowElement initialElement;


  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public boolean isExecutable() {
    return isExecutable;
  }

  public void setExecutable(boolean executable) {
    isExecutable = executable;
  }

  @Override
  public void addFlowElement(FlowElement flowElement) {
    flowElements.put(flowElement.id, flowElement);
  }

  @Override
  public Map<String, FlowElement> getFlowElements() {
    return flowElements;
  }

  @Override
  public void setFlowElements(
      Map<String, FlowElement> flowElements) {
    this.flowElements = flowElements;
  }

  @Override
  public FlowElement getInitialElement() {
    return initialElement;
  }

  @Override
  public void setInitialElement(FlowElement initialElement) {
    this.initialElement = initialElement;
  }

  @Override
  public String getModelType() {
    return "PROCESS";
  }
}
